﻿using KinonekoSoftware.JuXiaoYouDB.Documents.General.Properties;
using KinonekoSoftware.Studio.Pages.Instances.Core;

namespace KinonekoSoftware.Studio.Pages.Instances
{
    public sealed partial class XGInstanceEditorViewModel : TabViewModelCore
    {
        public XGInstanceEditorViewModel()
        {
            _layoutModeStack = new Stack<XGEditorLayoutMode>();

            Containers = new ObservableList<PropertyContainer>
            {
                new PropertyContainer
                {
                    Name = "Container #1",
                    Elements = new ObservableList<PropertyElement>
                    {
                        new StringElement{ Name = "Field #1", },
                        new StringElement{ Name = "Field #2", },
                        new StringElement{ Name = "Field #3", },
                        new StringElement{ Name = "Field #4", },
                    },
                },
                
                new PropertyContainer
                {
                    Name = "Container #2",
                    Elements = new ObservableList<PropertyElement>
                    {
                        new StringElement{ Name = "Field #1", },
                        new StringElement{ Name = "Field #2", },
                        new StringElement{ Name = "Field #3", },
                        new StringElement{ Name = "Field #4", },
                        new StringElement{ Name = "Field #5", },
                        new StringElement{ Name = "Field #6", },
                        new StringElement{ Name = "Field #7", },
                        new StringElement{ Name = "Field #8", },
                    },
                },
                
                
                new PropertyContainer
                {
                    Name = "Container #3",
                    Elements = new ObservableList<PropertyElement>
                    {
                        new StringElement{ Name = "Field #1", },
                        new StringElement{ Name = "Field #2", },
                        new StringElement{ Name = "Field #3", },
                        new StringElement{ Name = "Field #4", },
                        new StringElement{ Name = "Field #5", },
                        new StringElement{ Name = "Field #6", },
                    },
                },
            };
            
            PushPaintingWireframeCommand = CreateCommand(DoPushPaintingWireframeCommand);
        }
        
        public ObservableList<PropertyContainer> Containers { get; }

        protected override void OnStart()
        {
            InvalidateLayoutMode();
            base.OnStart();
        }
    }
}